home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
os2
/
remin301.zip
/
PATCH301.ZIP
/
PATCH.01
< prev
next >
Wrap
Text File
|
1992-12-28
|
70KB
|
2,203 lines
Prereq: "03.00.00"
*** ../p0/version.h Mon Nov 9 14:12:11 1992
--- ./version.h Wed Dec 16 10:51:27 1992
***************
*** 5,12 ****
/* What version of remind do we have? */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
! #define VERSION "03.00.00"
--- 5,12 ----
/* What version of remind do we have? */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
! #define VERSION "03.00.01"
*** ../p0/MANIFEST.DOS Mon Nov 9 14:12:36 1992
--- ./MANIFEST.DOS Wed Dec 16 10:51:55 1992
***************
*** 1,6 ****
--- 1,7 ----
calendar.c
config.h
copyrigh
+ defs.rem
dorem.c
dosubst.c
err.h
***************
*** 18,23 ****
--- 19,25 ----
main.c
makefile
makefile.msc
+ makefile.os2
makefile.tc
manifest.dos
manifest.unx
***************
*** 25,36 ****
--- 27,43 ----
protos.h
queue.c
readme.dos
+ readme.os2
readme.uni
rem
rem.1
+ rem2ps.1
+ rem2ps.c
+ rem2ps.h
remind-a.csh
remind-a.sh
remind.1
+ remind.def
test-rem
test.cmp
test.rem
*** ../p0/MANIFEST.UNX Mon Nov 9 14:12:36 1992
--- ./MANIFEST.UNX Wed Dec 16 10:51:55 1992
***************
*** 1,6 ****
calendar.c
config.h
! COPYRIGHT
dorem.c
dosubst.c
err.h
--- 1,14 ----
+ COPYRIGHT
+ MANIFEST.DOS
+ MANIFEST.UNX
+ Makefile
+ README.DOS
+ README.OS2
+ README.UNIX
+ WHATSNEW.30
calendar.c
config.h
! defs.rem
dorem.c
dosubst.c
err.h
***************
*** 16,36 ****
lnk.msc
lnk.tc
main.c
- Makefile
makefile.msc
makefile.tc
- MANIFEST.DOS
- MANIFEST.UNX
omit.c
protos.h
queue.c
- README.DOS
- README.UNIX
rem
rem.1
remind-all.csh
remind-all.sh
remind.1
test-rem
test.cmp
test.rem
--- 24,44 ----
lnk.msc
lnk.tc
main.c
makefile.msc
+ makefile.os2
makefile.tc
omit.c
protos.h
queue.c
rem
rem.1
+ rem2ps.1
+ rem2ps.c
+ rem2ps.h
remind-all.csh
remind-all.sh
remind.1
+ remind.def
test-rem
test.cmp
test.rem
***************
*** 41,44 ****
utils.c
var.c
version.h
- WHATSNEW.30
--- 49,51 ----
*** ../p0/Makefile Mon Nov 9 14:12:26 1992
--- ./Makefile Wed Dec 16 10:54:10 1992
***************
*** 7,13 ****
# Uncomment the next line if you are running on a SYSV system
# SYSV= -DSYSV
! # Uncomment the next line if you are running on any type of UNIX system
UNIX= -DUNIX
# Uncomment the next line if you want to use gcc instead of default compiler
--- 7,13 ----
# Uncomment the next line if you are running on a SYSV system
# SYSV= -DSYSV
! # Uncomment the next line if you are running under UNIX (including SYSV!)
UNIX= -DUNIX
# Uncomment the next line if you want to use gcc instead of default compiler
***************
*** 17,27 ****
CFLAGS= -O -ansi
CDEFS=
#-----------------------------------------------------------------------------
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config.h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
! VERSION= 03.00.00
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
STDHDRS= config.h types.h protos.h globals.h err.h
--- 17,51 ----
CFLAGS= -O -ansi
CDEFS=
+ #### INSTALLATION LOCATIONS ####
+ # Note that I use 'cp' rather than 'install' for improved portability.
+ #
+ # BINDIR: Where should the Remind executable be installed?
+ BINDIR= /usr/local/bin
+
+ # SCRIPTDIR: Where should the kall and rem shell scripts be installed?
+ SCRIPTDIR= /usr/share/bin
+
+ # MANDIR: Where should the man pages be installed?
+ MANDIR= /usr/local/man
+
+ # MANSECT: Which man section should the man pages go into?
+ MANSECT= 1
+
+ # EXEMODE: What file protection mode should be used for the executables?
+ EXEMODE= 755
+
+ # MANMODE: What file protection mode should be used for the man pages?
+ MANMODE= 644
+
+ # OWNER: What owner and group to use for executables, scripts and man pages?
+ OWNER=bin.bin
+
#-----------------------------------------------------------------------------
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config.h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
! VERSION= 03.00.01
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
STDHDRS= config.h types.h protos.h globals.h err.h
***************
*** 30,48 ****
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1
OBJS= $(SRCS:.c=.o)
! remind: $(OBJS)
! $(CC) -o remind $(OBJS)
.c.o:
$(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
clean:
rm -f *.o *~
calendar.o: calendar.c $(STDHDRS) expr.h
dorem.o: dorem.c $(STDHDRS) expr.h
dosubst.o: dosubst.c $(STDHDRS)
--- 54,79 ----
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
OBJS= $(SRCS:.c=.o)
! all: remind rem2ps
.c.o:
$(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
+ rem2ps: rem2ps.o
+ $(CC) -o rem2ps rem2ps.o
+
+ remind: $(OBJS)
+ $(CC) -o remind $(OBJS)
+
clean:
rm -f *.o *~
+ rem2ps.o: rem2ps.c
calendar.o: calendar.c $(STDHDRS) expr.h
dorem.o: dorem.c $(STDHDRS) expr.h
dosubst.o: dosubst.c $(STDHDRS)
***************
*** 61,75 ****
var.o: var.c $(STDHDRS) expr.h
tarZ:
! tar cvf remind-3.0.0.tar $(MANIFEST)
! compress -v remind-3.0.0.tar
shar:
shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
todos:
- mdel 'a:*.*'
- mdel 'a:*'
mcopy -tn $(MANIFEST) a:
fromdos:
--- 92,104 ----
var.o: var.c $(STDHDRS) expr.h
tarZ:
! tar cvf remind-3.0.1.tar $(MANIFEST)
! compress -v remind-3.0.1.tar
shar:
shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
todos:
mcopy -tn $(MANIFEST) a:
fromdos:
***************
*** 76,81 ****
--- 105,111 ----
mcopy -tn 'a:*' .
-mv -f copyrigh COPYRIGHT
-mv -f makefile Makefile
+ -mv -f readme.os2 README.OS2
-mv -f readme.dos README.DOS
-mv -f readme.uni README.UNIX
-mv -f remind-a.csh remind-all.csh
***************
*** 89,92 ****
cp $(MANIFEST) ../backup
transmit:
! sz -a -Z -e $(MANIFEST)
--- 119,154 ----
cp $(MANIFEST) ../backup
transmit:
! sz -a -e $(MANIFEST)
!
! install: install-bin install-scripts install-man
!
! install-bin: remind rem2ps
! cp remind $(BINDIR)/remind
! -chmod $(EXEMODE) $(BINDIR)/remind
! -chown $(OWNER) $(BINDIR)/remind
! cp rem2ps $(BINDIR)/rem2ps
! -chmod $(EXEMODE) $(BINDIR)/rem2ps
! -chown $(OWNER) $(BINDIR)/rem2ps
!
! install-scripts:
! cp kall $(SCRIPTDIR)/kall
! -chmod $(EXEMODE) $(SCRIPTDIR)/kall
! -chown $(OWNER) $(SCRIPTDIR)/kall
! cp rem $(SCRIPTDIR)/rem
! -chmod $(EXEMODE) $(SCRIPTDIR)/rem
! -chown $(OWNER) $(SCRIPTDIR)/rem
!
! install-man:
! cp remind.1 $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
! cp rem.1 $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
! cp kall.1 $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
! cp rem2ps.1 $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
*** ../p0/README.DOS Mon Nov 9 14:12:05 1992
--- ./README.DOS Wed Dec 16 10:51:22 1992
***************
*** 15,19 ****
--- 15,27 ----
This will create REMIND.EXE, which is ready to be executed.
+ The file "defs.rem" has some sample Remind definitions and commands.
+
--
David F. Skoll <dfs@doe.carleton.ca>
+ 4-317 LeBreton Street South
+ Ottawa, Ontario K1S 4L4
+ CANADA
+
+ Tel. (613) 567-3662
+
*** ../p0/README.UNIX Mon Nov 9 14:12:05 1992
--- ./README.UNIX Wed Dec 16 10:51:21 1992
***************
*** 16,25 ****
5 - Type 'make'
! 6 - Type 'test-rem' to run the acceptance test
! 7 - Copy the remind executable to the appropriate directory, and copy
! the man page to the man directory.
Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
These allow automatic mailing of reminders to all users who create a
--- 16,25 ----
5 - Type 'make'
! 6 - Type 'sh test-rem' to run the acceptance test
! 7 - Type 'make install' to install Remind, kall, rem and the man
! pages.
Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
These allow automatic mailing of reminders to all users who create a
***************
*** 38,46 ****
--- 38,61 ----
is provided. You should examine the script to ensure that the defaults
are correct.
+ Many people have asked me why I supply the "rem" script instead of
+ having Remind assume a default file. The answer is: That's how I like
+ it! My personal preference is for a program which normally takes
+ parameters to display usage information when invoked with no
+ parameters. I like that behaviour so I can quickly get an idea of
+ what a program does without poring through the man page. And I think
+ I'll keep Remind that way. Sorry to all who dislike it. :-)
+
A shell script called "kall" is provided so you can kill your background
remind processes when you log out. See the man page. Note that kall
depends on the output of "ps", and may not be portable.
+ The file "defs.rem" has some sample Remind definitions and commands.
+
--
David F. Skoll <dfs@doe.carleton.ca>
+ 4-317 LeBreton Street South
+ Ottawa, Ontario K1S 4L4
+ CANADA
+
+ Tel. (613) 567-3662
*** ../p0/WHATSNEW.30 Mon Nov 9 14:12:37 1992
--- ./WHATSNEW.30 Wed Dec 16 10:51:56 1992
***************
*** 1,5 ****
--- 1,50 ----
CHANGES TO REMIND
+ *** PLEASE NOTE: AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
+ 986 Eiffel Avenue,
+ Ottawa, Ontario
+ Canada
+
+ * Version 3.0 Patch 1
+
+ - Wrote the Rem2ps program to produce PostScript calendars
+
+ - Added an 'install' target to the Makefile
+
+ - Fixed a bug which allowed the shell() function to execute in timed
+ reminders which were queued with RUN disabled.
+
+ - Added support for OS/2, courtesy of DARREL HANKERSON
+ <HANK@DUCVAX.AUBURN.EDU>
+
+ - In expressions, can now specify literal dates as 'yyyy/mm/dd' rather than
+ using the date() function.
+
+ - Fixed all the source files to include "config.h" first.
+
+ - Changed the way triggers are calculated so that trigger dates are
+ always valid if year, month and day are specified, and there is no
+ UNTIL clause. See MAN page section "DETAILS ABOUT TRIGVALID()."
+
+ - Defined _POSIX_SOURCE so Remind will compile on SGI workstations (and
+ be more portable... I hope.)
+
+ - Fixed some rather brain-dead definitions of UPPER and LOWER, as pointed
+ out by <rsalz@osf.org>
+
+ - Added more details to the Man page concerning how triggers are computed,
+ and added warnings about computing OMIT dates.
+
+ - Added the file defs.rem which contains examples of useful definitions and
+ triggers.
+
+ - Changed the script test-rem to be a sh script instead of csh for improved
+ portability.
+
+ - Fixed up the README.* files to reflect the changes.
+
+ - Re-formatted the WHATSNEW.30 file.
+
* Version 3.0
- Total rewrite from previous versions
***************
*** 21,100 ****
- Fixed a lurking bug in trigger date calculation which, amazingly, had not
been caught in the couple of years that Remind has been out!
! * Version 2.4 Patch 5 - Added the "c+n" option for printing a calendar by
! weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
! * Version 2.3 Patch 4 - Made the init.c file nicer. Made the Makefile
! prettier. Added "make test", "make tar" and "make shar" Makefile targets.
! * Version 2.3 Patch 3 - Added a command-line option for Remind to process
! queued reminders in the foreground. This makes automatic termination
! of Remind processes from within X-Windows and Sunview easier.
! * Version 2.3 Patch 2 - Fixed up a problem with timed reminders which resulted
! in cursor not starting from left side of screen on some systems.
! Fixed the SIGINT handler for SYSV systems - this was interrupting the
! sleep(2) system call.
! Closed stdin and stdout if remind was part of a pipe - this prevents other
! sections of the pipe from hanging as remind puts itself in the background.
! Added the "-h" (Hush mode) option
! Added the "%#" and "%@" modifiers for the current time.
! Made the Makefile more portable
! * Version 2.3 Patch 1 - Added the "-t" command-line option to get Remind
! to trigger all non-expired reminders.
! Added Turbo C support courtesy of Rhys Weatherly
! Added the "RUN ON" and "RUN OFF" commands for a secure interface with
! the Elm mail system.
! Added the "rem" shell script for running Remind with a default script.
! Added manual pages for "kall" and "rem".
! * Version 2.3 - Added the UNTIL keyword for forcing reminders to expire.
! Added the "++" form of 'back' and the "--" form of 'delta' for
! ignoring OMIT information.
! Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
! keywords for isolating personal or peculiar reminders from the global
! OMIT context.
! Speeded up the parsing of tokens.
! Changed the source to recognize and exploit ANSI-C compilers which
! accept function prototypes.
! Added the "-n" option to output the next occurrence of each reminder
! in SimpleCalendar format
! Modified the calendar and SimpleCalendar formats so that the % escape
! substitutions ARE performed.
! * Version 2.2 - Patch 5 - Added the BEFORE, AFTER and SKIP tokens to make the
! handling of holidays more sensible. Also corrected a few more bugs.
! * Version 2.2 - Patch 3 - Added the MSG or RUN tokens in an OMIT command; also
! allowed RUN-type reminders to be explicitly included in the calendar by
! using the %" escape sequence.
! * Version 2.2 - Added the AT keyword, the timed reminders daemon, and the
! calendar facility.
! * Version 2.1 - Added the "repeat" token for repeating reminders with a period
! other than 7 days. Also fixed some bugs from version 2.0
! * Version 2.0 - first public release. Included advanced date specifications,
! character substitution, and the RUN keyword.
! * Version 1.0 - never publicly released.
--- 66,169 ----
- Fixed a lurking bug in trigger date calculation which, amazingly, had not
been caught in the couple of years that Remind has been out!
! * Version 2.4 Patch 5
! - Added the "c+n" option for printing a calendar by
! weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
! * Version 2.3 Patch 4
! - Made the init.c file nicer. Made the Makefile
! prettier. Added "make test", "make tar" and "make shar" Makefile targets.
! * Version 2.3 Patch 3
! - Added a command-line option for Remind to process
! queued reminders in the foreground. This makes automatic termination
! of Remind processes from within X-Windows and Sunview easier.
! * Version 2.3 Patch 2
! - Fixed up a problem with timed reminders which resulted
! in cursor not starting from left side of screen on some systems.
! - Fixed the SIGINT handler for SYSV systems - this was interrupting the
! sleep(2) system call.
! - Closed stdin and stdout if remind was part of a pipe - this prevents other
! sections of the pipe from hanging as remind puts itself in the background.
! - Added the "-h" (Hush mode) option
! - Added the "%#" and "%@" modifiers for the current time.
! - Made the Makefile more portable
! * Version 2.3 Patch 1
! - Added the "-t" command-line option to get Remind
! to trigger all non-expired reminders.
! - Added Turbo C support courtesy of Rhys Weatherly
! - Added the "RUN ON" and "RUN OFF" commands for a secure interface with
! the Elm mail system.
! - Added the "rem" shell script for running Remind with a default script.
! - Added manual pages for "kall" and "rem".
! * Version 2.3
! - Added the UNTIL keyword for forcing reminders to expire.
! - Added the "++" form of 'back' and the "--" form of 'delta' for
! ignoring OMIT information.
! - Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
! keywords for isolating personal or peculiar reminders from the global
! OMIT context.
! - Speeded up the parsing of tokens.
! - Changed the source to recognize and exploit ANSI-C compilers which
! accept function prototypes.
! - Added the "-n" option to output the next occurrence of each reminder
! in SimpleCalendar format
! - Modified the calendar and SimpleCalendar formats so that the % escape
! substitutions ARE performed.
!
! * Version 2.2 - Patch 5
!
! - Added the BEFORE, AFTER and SKIP tokens to make the
! handling of holidays more sensible. Also corrected a few more bugs.
!
! * Version 2.2 - Patch 3
!
! - Added the MSG or RUN tokens in an OMIT command; also
! allowed RUN-type reminders to be explicitly included in the calendar by
! using the %" escape sequence.
!
! * Version 2.2
!
! - Added the AT keyword, the timed reminders daemon, and the
! calendar facility.
!
! * Version 2.1
!
! - Added the "repeat" token for repeating reminders with a period
! other than 7 days. Also fixed some bugs from version 2.0
!
! * Version 2.0
!
! - first public release. Included advanced date specifications,
! character substitution, and the RUN keyword.
!
! * Version 1.0
!
! - never publicly released.
*** ../p0/calendar.c Mon Nov 9 14:12:13 1992
--- ./calendar.c Wed Dec 16 10:51:29 1992
***************
*** 173,182 ****
--- 173,202 ----
static void DoCalendarOneMonth()
#endif
{
+ int y, m, d, mm, yy;
+
if (!DoSimpleCalendar) WriteCalHeader();
+ if (PsCal) {
+ FromJulian(JulianToday, &y, &m, &d);
+ printf("%s\n", PSBEGIN);
+ printf("%s %d %d %d\n",
+ MonthName[m], y, DaysInMonth(m, y), (JulianToday+1) % 7);
+ mm = m-1;
+ if (mm<0) {
+ mm = 11; yy = y-1;
+ } else yy=y;
+
+ printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
+ mm = m+1;
+ if (mm>11) {
+ mm = 0; yy = y+1;
+ } else yy=y;
+ printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
+ }
while (WriteCalendarRow()) continue;
+ if (PsCal) printf("%s\n", PSEND);
if (!DoSimpleCalendar) WriteCalTrailer();
}
*** ../p0/config.h Mon Nov 9 14:12:07 1992
--- ./config.h Wed Dec 16 10:51:23 1992
***************
*** 7,13 ****
/* care of certain system dependencies. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
--- 7,13 ----
/* care of certain system dependencies. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
***************
*** 109,115 ****
--- 109,117 ----
/*---------------------------------------------------------------------*/
/* Do we have the <unistd.h> header? If not, use sys/files.h */
/*---------------------------------------------------------------------*/
+ #ifdef UNIX
#define HAVE_UNISTD 1
+ #endif
/*---------------------------------------------------------------------*/
/* How many attempts to resolve a weird date spec? */
***************
*** 151,153 ****
--- 153,162 ----
/*---------------------------------------------------------------------*/
#define PUBLIC
#define PRIVATE static
+
+ #ifdef UNIX
+ #define _POSIX_SOURCE
+ #endif
+
+ #define PSBEGIN "# rem2ps begin"
+ #define PSEND "# rem2ps end"
*** ../p0/dorem.c Mon Nov 9 14:12:13 1992
--- ./dorem.c Wed Dec 16 10:51:30 1992
***************
*** 10,17 ****
/* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
- #include <stdio.h>
#include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 10,17 ----
/* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
#include "config.h"
+ #include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
*** ../p0/dosubst.c Mon Nov 9 14:12:14 1992
--- ./dosubst.c Wed Dec 16 10:51:30 1992
***************
*** 9,17 ****
/* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
#include <stdio.h>
#include <ctype.h>
- #include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 9,17 ----
/* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
+ #include "config.h"
#include <stdio.h>
#include <ctype.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
***************
*** 110,116 ****
if (err) return err;
if (c == '\n') continue;
if (!c) {
! if (mode != CAL_MODE) *s++ = '\n';
*s++ = 0;
break;
}
--- 110,116 ----
if (err) return err;
if (c == '\n') continue;
if (!c) {
! if (mode != CAL_MODE && t->typ != RUN_TYPE) *s++ = '\n';
*s++ = 0;
break;
}
***************
*** 346,352 ****
s += strlen(s);
break;
! case '_': sprintf(s, "%s", NL);
s += strlen(s);
break;
--- 346,356 ----
s += strlen(s);
break;
! case '_':
! if (mode != CAL_MODE)
! sprintf(s, "%s", NL);
! else
! sprintf(s, " ");
s += strlen(s);
break;
*** ../p0/err.h Mon Nov 9 14:12:07 1992
--- ./err.h Wed Dec 16 10:51:24 1992
***************
*** 5,11 ****
/* Error definitions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
--- 5,11 ----
/* Error definitions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
*** ../p0/expr.c Mon Nov 9 14:12:16 1992
--- ./expr.c Wed Dec 16 10:51:32 1992
***************
*** 5,23 ****
/* This file contains routines to parse and evaluate */
/* expressions. */
/* */
! /* Copyright 1991 by David F. Skoll. */
/* */
/***************************************************************/
! /* If we're using Turbo C, turn off annoying warning messages! */
! #ifdef __TURBOC__
! #pragma warn -pia
! #endif
!
#include <stdio.h>
#include <ctype.h>
#include <string.h>
- #include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 5,18 ----
/* This file contains routines to parse and evaluate */
/* expressions. */
/* */
! /* Copyright 1992 by David F. Skoll. */
/* */
/***************************************************************/
! #include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
***************
*** 62,67 ****
--- 57,63 ----
PRIVATE int MakeValue ARGS ((char *s, Value *v, Var *locals));
PRIVATE int PushOpStack ARGS ((Operator *op));
PRIVATE int PopOpStack ARGS ((Operator *op));
+ PRIVATE int ParseLiteralDate ARGS ((char **s, int *jul));
/* Binary operators - all left-associative */
***************
*** 236,243 ****
if (c == '\"') return OK ; else return E_MISS_QUOTE;
}
! if (!ISID(c)) return E_ILLEGAL_CHAR;
/* Parse a constant, variable name or function */
while (ISID(**in) || **in == ':') *out++ = *(*in)++;
--- 232,249 ----
if (c == '\"') return OK ; else return E_MISS_QUOTE;
}
! /* Dates can be specified with single-quotes */
! if (c == '\'') {
! while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
! *out = 0;
! if (c == '\'') return OK ; else return E_MISS_QUOTE;
! }
+ if (!ISID(c)) {
+ Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
+ return E_ILLEGAL_CHAR;
+ }
+
/* Parse a constant, variable name or function */
while (ISID(**in) || **in == ':') *out++ = *(*in)++;
***************
*** 337,343 ****
r = Evaluate(s, locals);
if (r) return r;
if (*ExprBuf == ')') break;
! else if (*ExprBuf != ',') return E_ILLEGAL_CHAR;
}
if (f) r = CallFunc(f, args);
else {
--- 343,352 ----
r = Evaluate(s, locals);
if (r) return r;
if (*ExprBuf == ')') break;
! else if (*ExprBuf != ',') {
! Eprint("Expecting comma, found '%c'", *ExprBuf);
! return E_ILLEGAL_CHAR;
! }
}
if (f) r = CallFunc(f, args);
else {
***************
*** 352,358 ****
r = PushOpStack(f);
if (r) return r;
continue; /* Still looking for an atomic vlue */
! } else if (!ISID(*ExprBuf) && *ExprBuf != '"') {
return E_ILLEGAL_CHAR;
} else { /* Must be a literal value */
r = MakeValue(ExprBuf, &va, locals);
--- 361,368 ----
r = PushOpStack(f);
if (r) return r;
continue; /* Still looking for an atomic vlue */
! } else if (!ISID(*ExprBuf) && *ExprBuf != '"' && *ExprBuf != '\'') {
! Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
return E_ILLEGAL_CHAR;
} else { /* Must be a literal value */
r = MakeValue(ExprBuf, &va, locals);
***************
*** 408,415 ****
/***************************************************************/
/* */
/* MakeValue */
! /* Generate a literal value. It's either a string, a number */
! /* or the value of a symbol. */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
--- 418,425 ----
/***************************************************************/
/* */
/* MakeValue */
! /* Generate a literal value. It's either a string, a number, */
! /* a date or the value of a symbol. */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
***************
*** 435,440 ****
--- 445,457 ----
strncpy(v->v.str, s+1, len-1);
*(v->v.str+len-1) = 0;
return OK;
+ } else if (*s == '\'') { /* It's a literal date */
+ s++;
+ if ((r=ParseLiteralDate(&s, &h))) return r;
+ if (*s != '\'') return E_BAD_DATE;
+ v->type = DATE_TYPE;
+ v->v.val = h;
+ return OK;
} else if (isdigit(*s)) { /* It's a number - use len to hold it.*/
len = 0;
while (*s && isdigit(*s)) {
***************
*** 640,670 ****
} else return E_2LOW;
case STR_TYPE:
- y=0; m=0; d=0;
s = v->v.str;
! if (!isdigit(*s)) return E_CANT_COERCE;
! while (isdigit(*s)) {
! y *= 10;
! y += *s++ - '0';
! }
! if (*s++ != '/') return E_CANT_COERCE;
! if (!isdigit(*s)) return E_CANT_COERCE;
! while (isdigit(*s)) {
! m *= 10;
! m += *s++ - '0';
! }
! m--;
! if (*s++ != '/') return E_CANT_COERCE;
! if (!isdigit(*s)) return E_CANT_COERCE;
! while (isdigit(*s)) {
! d *= 10;
! d += *s++ - '0';
! }
! if (*s || y < BASE || y > BASE+YR_RANGE ||
! m>11 || d<1 || d>DaysInMonth(m, y)) return E_CANT_COERCE;
v->type = DATE_TYPE;
free(v->v.str);
! v->v.val = Julian(y, m, d);
return OK;
default: return E_CANT_COERCE;
--- 657,668 ----
} else return E_2LOW;
case STR_TYPE:
s = v->v.str;
! if (ParseLiteralDate(&s, &i)) return E_CANT_COERCE;
! if (*s) return E_CANT_COERCE;
v->type = DATE_TYPE;
free(v->v.str);
! v->v.val = i;
return OK;
default: return E_CANT_COERCE;
***************
*** 1209,1212 ****
--- 1207,1255 ----
dest->v.val = src->v.val;
return OK;
}
+ }
+
+ /***************************************************************/
+ /* */
+ /* ParseLiteralDate */
+ /* */
+ /* Parse a literal date. Return result in jul, update s. */
+ /* */
+ /***************************************************************/
+ #ifdef HAVE_PROTOS
+ PRIVATE int ParseLiteralDate(char **s, int *jul)
+ #else
+ static int ParseLiteralDate(s, jul)
+ char **s;
+ int *jul;
+ #endif
+ {
+ int y, m, d;
+
+ y=0; m=0; d=0;
+
+ if (!isdigit(**s)) return E_BAD_DATE;
+ while (isdigit(**s)) {
+ y *= 10;
+ y += *(*s)++ - '0';
+ }
+ if (*(*s)++ != '/') return E_BAD_DATE;
+ if (!isdigit(**s)) return E_BAD_DATE;
+ while (isdigit(**s)) {
+ m *= 10;
+ m += *(*s)++ - '0';
+ }
+ m--;
+ if (*(*s)++ != '/') return E_BAD_DATE;
+ if (!isdigit(**s)) return E_BAD_DATE;
+ while (isdigit(**s)) {
+ d *= 10;
+ d += *(*s)++ - '0';
+ }
+ if (y < BASE || y > BASE+YR_RANGE || m<0 ||
+ m>11 || d<1 || d>DaysInMonth(m, y)) return E_BAD_DATE;
+
+ *jul = Julian(y, m, d);
+
+ return OK;
}
*** ../p0/expr.h Mon Nov 9 14:12:08 1992
--- ./expr.h Wed Dec 16 10:51:24 1992
***************
*** 5,11 ****
/* Contains a few definitions used by expression evaluator. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
--- 5,11 ----
/* Contains a few definitions used by expression evaluator. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
*** ../p0/files.c Mon Nov 9 14:12:17 1992
--- ./files.c Wed Dec 16 10:51:33 1992
***************
*** 33,39 ****
#include <dos.h>
#endif
- #include "config.h"
#include "types.h"
#include "protos.h"
#include "globals.h"
--- 33,38 ----
***************
*** 428,434 ****
/* file. Not needed for UNIX. */
/* */
/***************************************************************/
! #ifdef __MSDOS__
/*
* WARNING WARNING WARNING WARNING
* In the version of Turbo C which I have, there is a bug in the
--- 427,433 ----
/* file. Not needed for UNIX. */
/* */
/***************************************************************/
! #if defined(__MSDOS__) || defined(OS2)
/*
* WARNING WARNING WARNING WARNING
* In the version of Turbo C which I have, there is a bug in the
***************
*** 449,463 ****
int jul;
#endif
{
! int y, m, d;
#ifdef __TURBOC__
struct ftime ft;
- #endif
FILE *f;
FromJulian(jul, &y, &m, &d);
-
- #ifdef __TURBOC__
ft.ft_tsec = 0;
ft.ft_min = 0;
ft.ft_hour = 12; /* Arbitrarily set time to noon. */
--- 448,460 ----
int jul;
#endif
{
!
#ifdef __TURBOC__
+ int y, m, d;
struct ftime ft;
FILE *f;
FromJulian(jul, &y, &m, &d);
ft.ft_tsec = 0;
ft.ft_min = 0;
ft.ft_hour = 12; /* Arbitrarily set time to noon. */
***************
*** 464,488 ****
ft.ft_day = (unsigned int) d;
ft.ft_month = (unsigned int) m+1;
ft.ft_year = (unsigned int) (y - 1980);
- #endif
! f = fopen(fname, "r");
!
! #ifdef __TURBOC__
if (!f || setftime(fileno(f) , &ft)) {
- #endif
! #ifdef __MSC__
! if (!f || _dos_setftime(fileno(f),
! ((y-1980)<<9) + (m+1)<<5 + d,
! (12<<11))) {
#endif
fprintf(ErrFp, "Can't reset access date of %s\n", fname);
if (f) fclose(f);
return -1;
}
fclose(f);
return 0;
}
#endif /* __MSDOS__ */
--- 461,485 ----
ft.ft_day = (unsigned int) d;
ft.ft_month = (unsigned int) m+1;
ft.ft_year = (unsigned int) (y - 1980);
! f = fopen(fname, "r");
if (!f || setftime(fileno(f) , &ft)) {
! #else /* Must be MSC */
! if (utime(fname, (struct utimbuf *) NULL)) {
#endif
fprintf(ErrFp, "Can't reset access date of %s\n", fname);
+
+ #ifdef __TURBOC__
if (f) fclose(f);
+ #endif
return -1;
}
+ #ifdef __TURBOC__
fclose(f);
+ #endif
+
return 0;
}
#endif /* __MSDOS__ */
*** ../p0/funcs.c Mon Nov 9 14:23:22 1992
--- ./funcs.c Wed Dec 16 10:51:34 1992
***************
*** 6,16 ****
/* expressions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
- #include <stdio.h>
#include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 6,16 ----
/* expressions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
#include "config.h"
+ #include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
***************
*** 26,32 ****
#include <sys/file.h>
#endif
#endif
- /* May have to change previous line to <sys/file.h> for some unixes */
#ifdef __MSDOS__
#include <io.h>
#define R_OK 4
--- 26,31 ----
***************
*** 127,134 ****
#define DCOPYVAL(x, y) ( (x) = (y), (y).type = ERR_TYPE )
/* Convenience macros */
! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
! #define LOWER(c) ( ((c) >= 'A' && (c) <= 'Z') ? (c) + 'a' - 'A' : (c) )
/* The array holding the built-in functions. */
Operator Func[] = {
--- 126,133 ----
#define DCOPYVAL(x, y) ( (x) = (y), (y).type = ERR_TYPE )
/* Convenience macros */
! #define UPPER(c) (islower(c) ? toupper(c) : c)
! #define LOWER(c) (isupper(c) ? tolower(c) : c)
/* The array holding the built-in functions. */
Operator Func[] = {
***************
*** 834,840 ****
/***************************************************************/
/* */
! /* FOstype - the type of operating system (UNIX or MSDOS) */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
--- 833,840 ----
/***************************************************************/
/* */
! /* FOstype - the type of operating system */
! /* (UNIX, OS/2, or MSDOS) */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
***************
*** 846,851 ****
--- 846,855 ----
#ifdef UNIX
return RetStrVal("UNIX");
#else
+ #ifdef __MSC__
+ if (_osmode == OS2_MODE)
+ return RetStrVal("OS/2");
+ #endif
return RetStrVal("MSDOS");
#endif
}
***************
*** 1362,1368 ****
PRIVATE FILE *popen(char *cmd, char *mode)
#else
static FILE *popen(cmd, mode)
! char *cmd, *mode
#endif
{
char *s;
--- 1366,1372 ----
PRIVATE FILE *popen(char *cmd, char *mode)
#else
static FILE *popen(cmd, mode)
! char *cmd, *mode;
#endif
{
char *s;
*** ../p0/globals.h Mon Nov 9 14:12:09 1992
--- ./globals.h Wed Dec 16 10:51:25 1992
***************
*** 7,13 ****
/* MK_GLOBALS. Also contains useful macro definitions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
--- 7,13 ----
/* MK_GLOBALS. Also contains useful macro definitions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
***************
*** 40,45 ****
--- 40,46 ----
EXTERN INIT( int DebugFlag, 0);
EXTERN INIT( char DoCalendar, 0);
EXTERN INIT( char DoSimpleCalendar, 0);
+ EXTERN INIT( char PsCal, 0);
EXTERN INIT( int CalWidth, 80);
EXTERN INIT( int CalWeeks, 0);
EXTERN INIT( int CalMonths, 0);
*** ../p0/init.c Mon Nov 9 14:12:19 1992
--- ./init.c Wed Dec 16 10:51:35 1992
***************
*** 36,41 ****
--- 36,42 ----
* -c[n] = Produce a calendar for n months (default = 1)
* -w[n] = Specify output device width (default = 80)
* -s[n] = Produce calendar in "simple calendar" format
+ * -p[n] = Produce calendar in format compatible with rem2ps
* -v = Verbose mode
* -o = Ignore ONCE directives
* -a = Don't issue timed reminders which will be queued
***************
*** 187,192 ****
--- 188,201 ----
if (!CalMonths) CalMonths = 1;
break;
+ case 'p':
+ case 'P':
+ DoSimpleCalendar = 1;
+ PsCal = 1;
+ PARSENUM(CalMonths, arg);
+ if (!CalMonths) CalMonths = 1;
+ break;
+
case 'w':
case 'W':
PARSENUM(CalWidth, arg);
***************
*** 303,309 ****
#endif
{
fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
! fprintf(ErrFp, "Usage: remind [options] filename [date]\n\n");
fprintf(ErrFp, "Options:\n");
fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
fprintf(ErrFp, " -r Disable RUN directives\n");
--- 312,318 ----
#endif
{
fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
! fprintf(ErrFp, " Usage: remind [options] filename [date]\n");
fprintf(ErrFp, "Options:\n");
fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
fprintf(ErrFp, " -r Disable RUN directives\n");
***************
*** 311,316 ****
--- 320,326 ----
fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
fprintf(ErrFp, " -w[n] Specify width (default 80) of calendar output\n");
fprintf(ErrFp, " -s[n] Produce 'simple calendar' for n (1) months\n");
+ fprintf(ErrFp, " -p[n] Same as -s, but input compatible with rem2ps\n");
fprintf(ErrFp, " -v Verbose mode\n");
fprintf(ErrFp, " -o Ignore ONCE directives\n");
fprintf(ErrFp, " -t Trigger all future reminders regardless of delta\n");
*** ../p0/main.c Mon Nov 9 14:12:20 1992
--- ./main.c Wed Dec 16 10:51:37 1992
***************
*** 16,21 ****
--- 16,24 ----
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
+ #ifdef HAVE_UNISTD
+ #include <unistd.h>
+ #endif
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDARG
***************
*** 27,32 ****
--- 30,38 ----
#ifdef __MSDOS__
#include <dos.h>
+ # ifdef __MSC__
+ # include <time.h>
+ # endif
#endif
***************
*** 101,108 ****
#endif
}
! /* If it's MS-DOS, reset the file access date */
! #ifdef __MSDOS__
if (RealToday == JulianToday) SetAccessDate(InitialFile, RealToday);
#endif
--- 107,114 ----
#endif
}
! /* If it's MS-DOS or OS2, reset the file access date */
! #if defined(__MSDOS__) || defined(OS2)
if (RealToday == JulianToday) SetAccessDate(InitialFile, RealToday);
#endif
***************
*** 569,575 ****
(void) vfprintf(ErrFp, fmt, argptr);
(void) fputc('\n', ErrFp);
#ifndef HAVE_STDARG
! va_end(argptr)
#endif
return;
}
--- 575,581 ----
(void) vfprintf(ErrFp, fmt, argptr);
(void) fputc('\n', ErrFp);
#ifndef HAVE_STDARG
! va_end(argptr);
#endif
return;
}
***************
*** 676,683 ****
long SystemTime()
#endif
{
! #ifdef __MSDOS__
! #ifdef __TURBOC__
/* Get time in Turbo C */
struct time t;
--- 682,688 ----
long SystemTime()
#endif
{
! #if defined( __MSDOS__ ) && defined( __TURBOC__ )
/* Get time in Turbo C */
struct time t;
***************
*** 685,701 ****
gettime(&t);
return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
(long) t.ti_sec;
-
#else
! /* Get time in Microsoft C */
! struct dostime_t tloc;
! _dos_gettime(&tloc);
! return (long) tloc.hour * 3600L + (long) tloc.minute * 60L +
! (long) tloc.second;
!
! #endif
! #else
! /* Get time in Unix */
time_t tloc;
struct tm *t;
--- 690,697 ----
gettime(&t);
return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
(long) t.ti_sec;
#else
! /* Get time in Unix or with MSC */
time_t tloc;
struct tm *t;
***************
*** 723,730 ****
int *y;
#endif
{
! #ifdef __MSDOS__
! #ifdef __TURBOC__
/* Get today's date in Turbo C */
struct date da;
--- 719,725 ----
int *y;
#endif
{
! #if defined( __MSDOS__ ) && defined( __TURBOC__ )
/* Get today's date in Turbo C */
struct date da;
***************
*** 733,751 ****
*m = da.da_mon - 1;
*d = da.da_day;
#else
! /* Get today's date in Microsoft C */
! struct dosdate_t buf;
!
! _dos_getdate(&buf);
!
! *d = buf.day;
! *m = buf.month - 1;
! *y = buf.year;
! #endif
! #else
! /* Get today's date in UNIX */
! time_t tloc;
! struct tm *t;
(void) time(&tloc);
t = localtime(&tloc);
--- 728,736 ----
*m = da.da_mon - 1;
*d = da.da_day;
#else
! /* Get today's date in UNIX or with MSC */
! time_t tloc;
! struct tm *t;
(void) time(&tloc);
t = localtime(&tloc);
*** ../p0/makefile.msc Mon Nov 9 14:12:34 1992
--- ./makefile.msc Wed Dec 16 10:51:53 1992
***************
*** 55,57 ****
--- 55,64 ----
remind.exe: $(OBJS)
link /NOI @lnk.msc
+
+ rem2ps.obj: rem2ps.c
+ cl /c $(DEFINES) $(MODEL) /Forem2ps.obj rem2ps.c
+
+ rem2ps.exe: rem2ps.obj
+ link /NOI rem2ps,rem2ps.exe,,,
+
*** ../p0/makefile.tc Mon Nov 9 14:12:33 1992
--- ./makefile.tc Wed Dec 16 10:51:51 1992
***************
*** 1,6 ****
# Makefile for REMIND for Turbo C for MSDOS
! VERSION= 03.00.00
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
--- 1,6 ----
# Makefile for REMIND for Turbo C for MSDOS
! VERSION= 03.00.01
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
***************
*** 15,27 ****
MANIFEST= readme.uni readme.dos copyrigh $(HDRS) $(SRCS) makefile rem rem.1 \
remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
! makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1
remind.exe: $(OBJS)
tcc @lnk.tc
.c.obj:
tcc -A -w-pia -c -O -ms {$< }
calendar.obj: calendar.c $(STDHDRS) expr.h
--- 15,35 ----
MANIFEST= readme.uni readme.dos copyrigh $(HDRS) $(SRCS) makefile rem rem.1 \
remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
! makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1 \
! defs.rem readme.os2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
+ all: remind.exe rem2ps.exe
+
remind.exe: $(OBJS)
tcc @lnk.tc
+ rem2ps.exe: rem2ps.obj
+ tcc -erem2ps.exe rem2ps.obj
+
.c.obj:
tcc -A -w-pia -c -O -ms {$< }
+
+ rem2ps.obj: rem2ps.c rem2ps.h config.h
calendar.obj: calendar.c $(STDHDRS) expr.h
*** ../p0/protos.h Mon Nov 9 14:12:10 1992
--- ./protos.h Wed Dec 16 10:51:26 1992
***************
*** 5,11 ****
/* Function Prototypes. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
--- 5,11 ----
/* Function Prototypes. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
***************
*** 110,112 ****
--- 110,113 ----
int DoPreserve ARGS ((Parser *p));
int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
+ int HashVal ARGS ((const char *str));
*** ../p0/queue.c Mon Nov 9 14:12:22 1992
--- ./queue.c Wed Dec 16 10:51:38 1992
***************
*** 8,18 ****
/* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
- #include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 8,18 ----
/* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
+ #include "config.h"
#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
***************
*** 19,24 ****
--- 19,27 ----
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
+ #ifdef HAVE_UNISTD
+ #include <unistd.h>
+ #endif
#include "globals.h"
#include "err.h"
#include "types.h"
***************
*** 174,179 ****
--- 177,183 ----
/* Trigger the reminder */
CreateParser(q->text, &p);
trig.typ = q->typ;
+ RunDisabled = q->RunDisabled;
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
fflush(stdout);
*** ../p0/remind.1 Mon Nov 9 14:12:29 1992
--- ./remind.1 Wed Dec 16 10:51:48 1992
***************
*** 1,4 ****
! .TH REMIND 1 "20 October 1992"
.UC4
.SH NAME
remind \- a sophisticated reminder service
--- 1,4 ----
! .TH REMIND 1 "11 November 1992"
.UC4
.SH NAME
remind \- a sophisticated reminder service
***************
*** 38,43 ****
--- 38,48 ----
format" which can be used as input for more sophisticated calendar-drawing
programs.
.TP
+ .B \-p\fR\fIn\fR
+ The \fB\-p\fR option is very similar to the \fB\-s\fR option, except
+ that the output contains additional information for use by the
+ \fBrem2ps\fR program, which creates a PostScript calendar.
+ .TP
.B \-v
The \fB\-v\fR option makes the output of \fBRemind\fR slightly more verbose.
.TP
***************
*** 1149,1163 ****
.RE
.TP
.B DATE constants
! \fBDATE\fR constants have no readable representation. They must be
! created with the \fBdate()\fR function, which takes the year, month
! and day as arguments:
.PP
.RS
! date(1992, 2, 29), date(1996, 4, 2), date(2001, 12, 17)
.PP
! However, \fBDATE\fR constants are \fIprinted\fR as
! \fIyyyy\fR/\fImm\fR/\fIdd\fR.
.RE
.PP
.B OPERATORS
--- 1154,1170 ----
.RE
.TP
.B DATE constants
! \fBDATE\fR constants are expressed as 'yyyy/mm/dd', and the single
! quotes \fImust\fR be supplied. This distinguishes date constants
! from division of integers. Examples:
.PP
.RS
! '1993/02/22', '1992/12/25', '1999/01/01'
.PP
! Note that \fBDATE\fR constants are \fIprinted\fR as
! \fIyyyy\fR/\fImm\fR/\fIdd\fR without the quotes. Note also that versions
! of \fBRemind\fR prior to 03.00.01 did not support date constants. In those
! versions, you must create dates using the \fBdate()\fR function.
.RE
.PP
.B OPERATORS
***************
*** 1372,1377 ****
--- 1379,1389 ----
a \fBSTRING\fR consisting of the characters specified by the arguments.
Note that none of the arguments can be 0, unless there is only one
argument. As a special case, \fBchar(0)\fR returns "".
+ .PP
+ Note that because \fBRemind\fR does not support escaping of characters
+ in strings, the only way to get a double-quote in a string is to use
+ \fBchar(34)\fR. Yes, I know it's not portable - it assumes ASCII
+ coding.
.TP
.B choose(i_index, x_arg1 [,x_arg2...])
\fBChoose\fR must take at least two arguments, the first of which is
***************
*** 1525,1531 ****
\fBord(2)\fR returns "2nd", and \fBord(213)\fR returns "213th".
.TP
.B ostype()
! Returns "UNIX" on UNIX systems, and "MSDOS" on MS-DOS systems.
.TP
.B plural(i_num [,s_str1 [,s_str2]])
Can take from one to three arguments. If one argument is supplied, returns
--- 1537,1545 ----
\fBord(2)\fR returns "2nd", and \fBord(213)\fR returns "213th".
.TP
.B ostype()
! Returns "UNIX" on UNIX systems, "MSDOS" on MS-DOS systems, and "OS/2"
! on OS/2 systems. If you run \fBRemind\fR in an MS-DOS box under OS/2,
! this function returns "MSDOS".
.TP
.B plural(i_num [,s_str1 [,s_str2]])
Can take from one to three arguments. If one argument is supplied, returns
***************
*** 1615,1621 ****
.TP
.B version()
Returns a string specifying the version of \fBRemind\fR. For version
! 03.00.00, returns "03.00.00". It is guaranteed that as new versions of
\fBRemind\fR are released, the value returned by \fBversion()\fR will
strictly increase, according to the rules for string ordering.
.TP
--- 1629,1635 ----
.TP
.B version()
Returns a string specifying the version of \fBRemind\fR. For version
! 03.00.01, returns "03.00.01". It is guaranteed that as new versions of
\fBRemind\fR are released, the value returned by \fBversion()\fR will
strictly increase, according to the rules for string ordering.
.TP
***************
*** 2009,2024 ****
.PP
.SH CALENDAR MODE
.PP
! If you supply the \fB\-c\fR or \fB\-s\fR command-line option, the \fBRemind\fR
runs in "calendar mode." In this mode, \fBRemind\fR interprets the script
repeatedly, performing one iteration through the whole file for each day
in the calendar. Reminders which trigger are saved in internal buffers,
and then inserted into the calendar in the appropriate places.
.PP
! For example, if you have a reminder script called ".reminders", and you
! executed this command:
.PP
.nf
remind -c .reminders jan 1993
.fi
.PP
--- 2023,2049 ----
.PP
.SH CALENDAR MODE
.PP
! If you supply the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR
! command-line option, then \fBRemind\fR
runs in "calendar mode." In this mode, \fBRemind\fR interprets the script
repeatedly, performing one iteration through the whole file for each day
in the calendar. Reminders which trigger are saved in internal buffers,
and then inserted into the calendar in the appropriate places.
.PP
! The \fB\-p\fR option is used in conjunction with the \fBrem2ps\fR
! program to produce a calendar in PostScript format. For example, the
! following command will send PostScript code to standard output:
.PP
.nf
+ remind -p .reminders | rem2ps
+ .fi
+ .PP
+ You can print a PostScript calendar by piping this to the \fBlpr\fR command.
+ .PP
+ If you have a reminder script called ".reminders", and you
+ execute this command:
+ .PP
+ .nf
remind -c .reminders jan 1993
.fi
.PP
***************
*** 2205,2210 ****
--- 2230,2249 ----
that the trigger date is issued only in election years, which are
multiples of 4. The second \fBREM\fR command actually issues the
reminder.
+ .PP
+ .B DETAILS ABOUT TRIGVALID()
+ .PP
+ The \fBtrigvalid()\fR function returns 1 if \fBRemind\fR could find a trigger
+ date for the previous \fBREM\fR or \fBIFTRIG\fR command. More specifically,
+ it returns 1 if \fBRemind\fR finds a date \fInot in the past\fR which
+ satisfies the trigger. In addition, there is one special case in which
+ \fBtrigvalid()\fR returns 1 and \fBtrigdate()\fR returns a meaningful result:
+ .PP
+ If the \fBREM\fR or \fBIFTRIG\fR command did not contain an \fBUNTIL\fR
+ clause, and contained all of the \fIday\fR, \fImonth\fR and \fIyear\fR
+ components, then \fBRemind\fR will correctly compute a trigger date, even
+ if it happens to be in the past. Note that this behaviour is not true for
+ versions of \fBRemind\fR prior to 03.00.01.
.SH AUTHOR
.PP
David F. Skoll
***************
*** 2212,2218 ****
.PP
Date calculation is a bit "brute force."
.PP
! The MS-DOS version of \fBRemind\fR does not support queuing or timed
activation of reminders.
.PP
\fBRemind\fR has some built-in limits on total line length,
--- 2251,2257 ----
.PP
Date calculation is a bit "brute force."
.PP
! The MS-DOS and OS/2 versions of \fBRemind\fR do not support queuing or timed
activation of reminders.
.PP
\fBRemind\fR has some built-in limits on total line length,
***************
*** 2220,2223 ****
.PP
.SH SEE ALSO
.pp
! rem, elm, kall
--- 2259,2262 ----
.PP
.SH SEE ALSO
.pp
! rem, elm, kall, rem2ps
*** ../p0/test-rem Mon Nov 9 14:12:33 1992
--- ./test-rem Wed Dec 16 10:51:51 1992
***************
*** 1,8 ****
! #!/bin/csh -f
! setenv TEST_GETENV "foo bar baz"
./remind -e -dxtev ./test.rem 16 feb 1991 > ./test.out
cmp -s ./test.out ./test.cmp
! if ($status == 0) then
echo "Remind: Acceptance test PASSED"
exit 0
else
--- 1,8 ----
! #!/bin/sh
! TEST_GETENV="foo bar baz" ; export TEST_GETENV
./remind -e -dxtev ./test.rem 16 feb 1991 > ./test.out
cmp -s ./test.out ./test.cmp
! if [ "$?" = "0" ]; then
echo "Remind: Acceptance test PASSED"
exit 0
else
***************
*** 11,14 ****
echo "Examine the file test.out to see where it differs from the"
echo "reference file test.cmp."
exit 1
! endif
--- 11,14 ----
echo "Examine the file test.out to see where it differs from the"
echo "reference file test.cmp."
exit 1
! fi
*** ../p0/test.cmp Mon Nov 9 14:12:33 1992
--- ./test.cmp Wed Dec 16 10:51:51 1992
***************
*** 349,355 ****
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
! version() => "03.00.00"
set a059 wkday(today())
today() => 1991/02/16
wkday(1991/02/16) => "Saturday"
--- 349,355 ----
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
! version() => "03.00.01"
set a059 wkday(today())
today() => 1991/02/16
wkday(1991/02/16) => "Saturday"
***************
*** 453,459 ****
a048 "foo"
a067 "INT"
a039 "February"
! a058 "03.00.00"
a049 21
a068 "STRING"
a059 "Saturday"
--- 453,459 ----
a048 "foo"
a067 "INT"
a039 "February"
! a058 "03.00.01"
a049 21
a068 "STRING"
a059 "Saturday"
*** ../p0/token.c Mon Nov 9 14:12:22 1992
--- ./token.c Wed Dec 16 10:51:39 1992
***************
*** 6,17 ****
/* classifying the tokens parsed. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
#include <stdio.h>
#include <ctype.h>
- #include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 6,17 ----
/* classifying the tokens parsed. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
+ #include "config.h"
#include <stdio.h>
#include <ctype.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
*** ../p0/trigger.c Mon Nov 9 14:12:23 1992
--- ./trigger.c Wed Dec 16 10:51:40 1992
***************
*** 5,16 ****
/* Routines for figuring out the trigger date of a reminder */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
- #include <stdio.h>
#include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 5,16 ----
/* Routines for figuring out the trigger date of a reminder */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
#include "config.h"
+ #include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
***************
*** 439,448 ****
--- 439,456 ----
fprintf(ErrFp, "%s(%d): Expired\n",
FileName, LineNo);
}
+ if (result != -1) {
+ LastTriggerDate = result;
+ LastTrigValid = 1;
+ }
return -1;
}
/* Keep scanning... unless there's no point in doing it.*/
if (nextstart <= start) {
+ if (result != -1) {
+ LastTriggerDate = result;
+ LastTrigValid = 1;
+ }
if (DebugFlag & DB_PRTTRIG) {
fprintf(ErrFp, "%s(%d): Expired\n",
FileName, LineNo);
*** ../p0/types.h Mon Nov 9 14:12:10 1992
--- ./types.h Wed Dec 16 10:51:26 1992
***************
*** 5,11 ****
/* Type definitions all dumped here. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
/* Values */
--- 5,11 ----
/* Type definitions all dumped here. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
/* Values */
*** ../p0/utils.c Mon Nov 9 14:12:24 1992
--- ./utils.c Wed Dec 16 10:51:41 1992
***************
*** 5,17 ****
/* Useful utility functions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
#include <string.h>
#include <stdio.h>
- #include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 5,17 ----
/* Useful utility functions. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
+ #include "config.h"
#include <string.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
***************
*** 18,25 ****
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
/***************************************************************/
/* */
--- 18,26 ----
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
+ #include <ctype.h>
! #define UPPER(c) (islower(c) ? toupper(c) : c)
/***************************************************************/
/* */
*** ../p0/var.c Mon Nov 9 14:12:25 1992
--- ./var.c Wed Dec 16 10:51:42 1992
***************
*** 6,17 ****
/* user- and system-defined variables. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1991 by David F. Skoll. */
/* */
/***************************************************************/
- #include <stdio.h>
#include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
--- 6,17 ----
/* user- and system-defined variables. */
/* */
/* This file is part of REMIND. */
! /* Copyright (C) 1992 by David F. Skoll. */
/* */
/***************************************************************/
#include "config.h"
+ #include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
***************
*** 18,23 ****
--- 18,24 ----
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
+ #include <ctype.h>
#include "types.h"
#include "expr.h"
#include "globals.h"
***************
*** 24,30 ****
#include "protos.h"
#include "err.h"
! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
/* The variable hash table */
#define VAR_HASH_SIZE 64
--- 25,31 ----
#include "protos.h"
#include "err.h"
! #define UPPER(c) (islower(c) ? toupper(c) : c)
/* The variable hash table */
#define VAR_HASH_SIZE 64
***************
*** 377,383 ****
/***************************************************************/
/* */
! /* DoPreserve - delete a bunch of variables. */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
--- 378,384 ----
/***************************************************************/
/* */
! /* DoPreserve - preserve a bunch of variables. */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS